package com.wynet.controller;

import com.wynet.entity.Users;
import com.wynet.service.intf.UsersService;
import com.wynet.vo.PageVo;
import com.wynet.vo.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/api/users/")
public class UsersController {
    @Resource
    private UsersService service;

    @ResponseBody
    @RequestMapping("add.do")
    public R add(Users users){
        return service.add(users);
    }

    @ResponseBody
    @RequestMapping("page.do")
    public PageVo Page(int page, int limit){
        return service.queryPage(page, limit);
    }
}
